package com.mida.dms.knw.mapper;

import com.mida.dms.knw.entity.KnwNoumenonRelation;
import com.mida.dms.knw.entity.vo.BodyTreeVo;
import com.mida.dms.knw.entity.vo.KnwNoumenonRelationVo;
import com.mida.dms.knw.entity.vo.MapperPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface KnwNoumenonRelationMapper extends BaseMapper<KnwNoumenonRelation> {

    int selectDistinct(@Param("sourceNoumenonSoid") Long sourceNoumenonSoid, @Param("targetNoumenonSoid") Long targetNoumenonSoid,@Param("conceptualSoid")Long conceptualSoid);

    int enable(Long soid);

    int disable(Long soid);

    /**
     * 分页
     * @param
     * @return
     */
    List<KnwNoumenonRelationVo> findRelationPage(MapperPage page) throws Exception;

    /**
     * 根据目标本体soid查询本体关系记录
     */
    List<Long> selectRelationByTargetSoid(Long soid);

    List<KnwNoumenonRelationVo> selectByTargetSoid(Long soid);

    List<KnwNoumenonRelation> selectRelationForHistory(Long soid);

    List<KnwNoumenonRelationVo> findAllRelation();

    List<BodyTreeVo> getBodyTree(List<Long> noumenonSoids) throws Exception;

    int updateByPrimaryKeySelective(KnwNoumenonRelation relation);
}